
package fei.zhou.service8083.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * 描述该类
 * 
 * @class: HelloController
 * @date 2021/8/22 15:54
 * @author <a href="mailto:zhoufei@smartdot.com">周飞</a>
 * @Verson 1.0 -2021/8/22 15:54
 * @see
 */
@RestController
@RequestMapping("zipkin")
public class HelloController {

    public static final String url = "http://localhost:8084/zipkin/service4";


    @Autowired
    OkHttpClient client;

    @GetMapping("/service3")
    public String service() throws Exception {
        System.out.println("-----调用service3-----");
        Request request = new Request.Builder().url(url).build();
        Response response = client.newCall(request).execute();
        return "service3," + response.body().string();
    }
}